<template>
  <div>
    <div class="titles">
      <i @click="goBack" class="iconfont fl">&#xe624;</i>
      <h3 class="title-h3">设置</h3>
    </div>
    <!--<div class="setUp-div">
      <ul>
        <li>关于我们<span class="fr ">></span></li>
      </ul>
    </div>-->
    <div class="btn-div" @click="doExit">退出</div>
  </div>
</template>

<script>
export default {
  data () {
    return {
    }
  },
  mounted () {
    let that = this
    mui.init({
      keyEventBind: {
        backbutton: true  //关闭back按键监听
      }
    })
    mui.back = function () {
      that.$router.push({
        path: '/index/person'
      })
      error
    }
  },
  methods: {
    goBack () {
      this.$router.push('/index/person')
    },
    doExit () {
      this.$messagebox.confirm('确定要退出吗?').then(() => {
        localStorage.clear()
        this.$store.state.isLogin = false
        this.$store.state.list = ''
        this.$store.state.isHot = false
        this.$store.state.goodsNum = 0
        this.$store.state.goodsName = ''
        this.$store.state.goodsColor = ''
        this.$store.state.goodsMemory = ''
        this.$store.state.goods_price = 0
        this.$store.state.sku = 0
        this.$store.state.userPhone = ''
        this.$store.state.passWord = ''
        this.$store.state.nickName = ''
        this.$router.push('/')
      }).catch(() => {
        return false
      })
    }
  }
}
</script>

<style scoped>
  .titles{
    height: 1.6rem;
    position: fixed;
    z-index: 10;
    box-sizing: border-box;
    left: 0;
    right: 0;
    top: 0;
    background: #fff;
  }
  .title-h3{
    text-align: center;
    line-height: 1.6rem;
    font-size: .8rem;
  }
  .iconfont{
    line-height: 1.6rem;
    left: .5rem;
    font-size: .8rem;
    position: absolute;
  }
  .my-swiper{
    border-radius: .5rem;
  }
  .title-div{
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    flex: 1;
  }
  .setUp-div{
    margin: 1.7rem 3% 0;
    border-radius: .3rem;
    box-shadow: 0 0 0.3rem #b5b5b6;
    background: #fff;
    font-size: .6rem;
    line-height: 1.5rem;
    padding: .5rem;
  }
  .btn-div{
    background: #e94c75;
    color: #fff;
    text-align: center;
    border-radius: .8rem;
    height: 1.6rem;
    line-height: 1.6rem;
    font-size: .7rem;
    /*margin-top: 1.3rem;*/
    margin-top: 2.3rem;
    margin-left: 3%;
    margin-right: 3%;
  }
</style>
